<template>
    <div>
        <ElForm v-model="submitForm">
            <ElInput  v-model:model-value="name"></ElInput>
            <ElInput v-model:model-value="password" type="password"></ElInput>
            <el-button type="primary" @click="submit">提交</el-button>
        </ElForm>
    </div>
</template>
<script>
import { ElButton, ElForm, ElInput } from 'element-plus'
import { getCurrentInstance, inject } from 'vue'
import VueCookies from 'vue-cookies'
import http from '@/utils/httpRequest'

export default {
    data() {
        return {
            submitForm: {
                name: '',
                password: '',
                code: ''
            }
        };
    },
    setup() {
    },
    created: () => {
        console.log('1', getCurrentInstance().appContext.config.globalProperties.$cookies.get('hh'));
        console.log('2', VueCookies.get('hh'));
    },
    methods: {
        submit() {
            http({
                url:http.adornUrl('/login'),
                method:'post'                
            }).then(res=>{
                //成功辣
                console.log(res)
            }).catch( e=>{
                console.log('失败辣',e)
            });
        }
    },
    components: { ElForm, ElInput, ElButton }
}
</script>
